summaryrefslogtreecommitdiff
path: root/ui/routes/(login)/invite/[invite]/+page.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'ui/routes/(login)/invite/[invite]/+page.svelte')
-rw-r--r--ui/routes/(login)/invite/[invite]/+page.svelte52
1 files changed, 26 insertions, 26 deletions
diff --git a/ui/routes/(login)/invite/[invite]/+page.svelte b/ui/routes/(login)/invite/[invite]/+page.svelte
index 65f5a97..18bf437 100644
--- a/ui/routes/(login)/invite/[invite]/+page.svelte
+++ b/ui/routes/(login)/invite/[invite]/+page.svelte
@@ -1,36 +1,36 @@
<script>
- import { goto } from '$app/navigation';
- import { acceptInvite } from '$lib/apiServer';
+ import { goto } from '$app/navigation';
+ import { acceptInvite } from '$lib/apiServer';
- import LogIn from '$lib/components/LogIn.svelte';
+ import LogIn from '$lib/components/LogIn.svelte';
- let { data } = $props();
+ let { data } = $props();
- let username = $state(''),
- password = $state('');
- let pending = false;
- let disabled = $derived(pending);
+ let username = $state(''),
+ password = $state('');
+ let pending = false;
+ let disabled = $derived(pending);
- async function onSubmit(event) {
- event.preventDefault();
- pending = true;
- const response = await acceptInvite(data.invite.id, username, password);
- if (200 <= response.status && response.status < 300) {
- username = '';
- password = '';
- goto('/');
- }
- pending = false;
- }
+ async function onSubmit(event) {
+ event.preventDefault();
+ pending = true;
+ const response = await acceptInvite(data.invite.id, username, password);
+ if (200 <= response.status && response.status < 300) {
+ username = '';
+ password = '';
+ goto('/');
+ }
+ pending = false;
+ }
</script>
{#await data.invite}
- <div class="card m-4 p-4">
- <p>Loading invitation…</p>
- </div>
+ <div class="card m-4 p-4">
+ <p>Loading invitation…</p>
+ </div>
{:then invite}
- <div class="card m-4 p-4">
- <p>Hi there! {invite.issuer} invites you to the conversation.</p>
- </div>
- <LogIn {disabled} bind:username bind:password onsubmit={onSubmit} />
+ <div class="card m-4 p-4">
+ <p>Hi there! {invite.issuer} invites you to the conversation.</p>
+ </div>
+ <LogIn {disabled} bind:username bind:password onsubmit={onSubmit} />
{/await}